<template>
  <header class="app-header">
    <div class="container">
      <h1 class="logo"><RouterLink to="/"></RouterLink></h1>
      <AppHeaderNav></AppHeaderNav>
      <div class="search">
        <i class="iconfont icon-search"></i>
        <input type="text" placeholder="搜一搜" />
      </div>
      <AppHeaderCart></AppHeaderCart>
    </div>
  </header>
</template>

<script>
import AppHeaderNav from "@/components/AppHeaderNav";
import AppHeaderCart from "@/components/AppHeaderCart";
export default {
  name: "AppHeader",
  components: { AppHeaderNav, AppHeaderCart },
};
</script>
<style scoped lang="less">
.app-header {
  background: #fff;
  .container {
    display: flex;
    align-items: center;
  }
  .logo {
    width: 200px;
    a {
      display: block;
      height: 132px;
      width: 100%;
      text-indent: -9999px;
      background: url(../assets/images/logo.png) no-repeat center 18px / contain;
    }
  }
  .app-header-nav {
    width: 820px;
    display: flex;
    justify-content: space-around;
    padding-left: 40px;
    position: relative;
    z-index: 998;

    > li {
      margin-right: 40px;
      width: 38px;
      text-align: center;

      > a {
        font-size: 16px;
        line-height: 32px;
        height: 32px;
        display: inline-block;
      }

      &:hover {
        > a {
          color: @xtxColor;
          border-bottom: 1px solid @xtxColor;
        }

        > .layer {
          height: 132px;
          opacity: 1;
        }
      }
    }
  }
  .search {
    width: 170px;
    height: 32px;
    position: relative;
    border-bottom: 1px solid #e7e7e7;
    line-height: 32px;
    .icon-search {
      font-size: 18px;
      margin-left: 5px;
    }
    input {
      width: 140px;
      padding-left: 5px;
      color: #666;
    }
  }
}
</style>
